﻿using System.Diagnostics;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ProdControls;

namespace ProdControlsTests {
    [TestClass]


    public class ProdButtonTests {

        [ClassInitialize]
        public static void Setup(TestContext context){
            //Start the Winforms Application
            Process.Start("WindowsFormsApplication.exe");
            Process.Start("WpfFormTestWindow.exe");

        }
        [TestMethod]
        public void WinFormsButtonClickTest() {
            
            ProdWindow _win = new ProdWindow("Form1");
            ProdButton _button = new ProdButton(_win,"button1");
            _button.Invoke();
            
            ProdWindow _popup = new ProdWindow("Test");
            ProdButton _popupOk = new ProdButton(_popup,"Ok");
            Assert.IsNotNull(_popup);
           _popupOk.Invoke();
           // _win.Close();
        }

        [TestMethod]
        public void WpfButtonClickTest() {

            ProdWindow _win = new ProdWindow("Main");
            ProdButton _button = new ProdButton(_win, "button");
            _button.Invoke();

            ProdWindow _popup = new ProdWindow("Wpf Button");
            ProdButton _popupOk = new ProdButton(_popup, "Ok");
            Assert.IsNotNull(_popup);
            _popupOk.Invoke();
           // _win.Close();
        }
    }
}
